tests: Make sure number of runs is 1.
authorBenjamin Otte <otte@redhat.com>
Sun, 25 Dec 2016 18:51:30 +0000 (19:51 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 26 Dec 2016 16:22:01 +0000 (17:22 +0100)
tests/rendernode.c

index 5222b7b741395994e306b987119e0b376c38cf0c..d7924d233adb58611802c8f12fdac715602b7b5d 100644 (file)
@@ -3,7 +3,7 @@
 static gboolean benchmark = FALSE;
 static gboolean dump_variant = FALSE;
 static gboolean fallback = FALSE;
-static int runs;
+static int runs = 1;
 
 static GOptionEntry options[] = {
   { "benchmark", 'b', 0, G_OPTION_ARG_NONE, &benchmark, "Time operations", NULL },
@@ -32,6 +32,11 @@ main(int argc, char **argv)
       return 1;
     }
 
+  if (runs < 1)
+    {
+      g_printerr ("Number of runs given with -r/--runs must be at least 1 and not %d.\n", runs);
+      return 1;
+    }
   if (!(argc == 3 || (argc == 2 && (dump_variant || benchmark))))
     {
       g_printerr ("Usage: %s [OPTIONS] NODE-FILE PNG-FILE\n", argv[0]);